<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<TITLE>${myfn:getGroupName(theForm.qryGroupID)}_${forumForm.title}</TITLE>
	<meta content="${forumForm.title}"  name="keywords"/>
	<meta content="${forumForm.title}" name="description" />
	<link href="${cpath}/css/youlin.css" rel="stylesheet" type="text/css" media="all" />
	<SCRIPT src="${cpath}/js/glk_array.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${cpath}/js/glr_array.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${cpath}/js/glfun.js"	   type=text/javascript></SCRIPT>
</head>
<body>
<script> 
	var curreplyID = "";
</script>
<!--外套 start -->
<div class="wrap">
  <!--页首 start -->
	<%@ include file="/menu.jsp"%>
  <!--页首 end -->  
  
  <!--导航面包屑 start -->
  <div class="breadCrumb">
  <div class="breadCrumbNav">当前位置：<a href="${cpath}/users.do?action=main">我的主页</a> >> 
  <c:if test="${theForm.qryGroupID != 99999999}">
  <a href="${cpath}/group_get/groupID_${theForm.qryGroupID}.html">部落</a>
  </c:if>
  <c:if test="${theForm.qryGroupID == 99999999}">
  <a href="${cpath}/shequ_home/villageID_${theForm.qryVillageID}.html">社区</a>
  </c:if>
  </div>
	<%@ include file="/navf.jsp"%> 
 </div> 
  <!--导航面包屑 end -->
  
  <!--主体 start -->
 <div class="body">
 
  <div class="hotBox1">  
    <div class="hotBox1-left">
	<c:if test="${theForm.qryGroupID != 99999999}">
      <a href="${cpath}/group_get/groupID_${theForm.qryGroupID}.html"><img src="${cpath}/${myfn:getGroupPic(theForm.qryGroupID)}"   width="75" height="75" class="shequ icon user_icon_2"></a>
      <p class="nav"><a href="${cpath}/group_get/groupID_${theForm.qryGroupID}.html">${myfn:getGroupName(theForm.qryGroupID)}</a>&nbsp;&gt;&nbsp;<a href="${cpath}/gforum_adlist/qryGroupID_${theForm.qryGroupID}.html">话题区</a></p>
	</c:if>
	<c:if test="${theForm.qryGroupID == 99999999}">
      <a href="${cpath}/shequ_home/villageID_${theForm.qryVillageID}.html"><img src="${cpath}/images/fm.jpg"    width="75" height="75" class="shequ icon user_icon_2"></a>
      <p class="nav"><a href="${cpath}/shequ_home/villageID_${theForm.qryVillageID}.html">${myfn:getVillageName(theForm.qryVillageID)}</a>&nbsp;&gt;&nbsp;<a >社区资料（${myfn:getProperty(4,forumForm.firsort)}）</a></p>
	</c:if>
    </div>
    <div class="hotBox1-right">
      <p><a href="javascript:history.go(-1);"><img src="${cpath}/images/icon_32.gif" width="137" height="25" /></a></p>
      <c:if test="${myfn:groupAddFlag(theForm.qryGroupID,userID) ==  1}">
	  <p><a href="${cpath}/gforum.do?action=addPage&groupID=${forumForm.groupID}"><img src="${cpath}/images/icon_31.gif" width="215" height="44" /></a></p> 
	  </c:if>
    </div>
  </div> 

<form action="${cpath}/gfollforum.do" name="theForm"  method="post" enctype="multipart/form-data" >
<div class="left-Box6">
  <h3><a href="${cpath}/gfollforum_list/qryGForumID_${forumForm.GForumID}.html">${forumForm.title}</a></h3>
  <div class="left-Box6-content">
   <div class="left-Box6-content-inner">     
     
   <table class="bl-detail" width="95%" align="center" cellpadding="0" cellspacing="0" style="margin:0 auto;">  
     <tr class="bl-detail-top1">
       <td width="14%" height="34"><b class="color_red">楼主：<a href="${cpath}/users_home/userID_${forumForm.userID}.html">${myfn:getUserNick(forumForm.userID)}</a></b></td>
       <td width="64%"><span>${myfn:formatDate14(forumForm.mtime, "-")}</span></td>
       <td width="22%" align="right">
        <c:if test="${myfn:isGroupManager(theForm.qryGroupID,userID) ==  true || forumForm.userID == userID}">
		<a href="${cpath}/gforum_del/GForumID_${forumForm.GForumID}.html"><img src="${cpath}/images/icon_36.gif" width="14" height="14" /> [删除] </a> 
		</c:if>
		<c:if test="${forumForm.userID == userID && theForm.qryGroupID == 99999999 }">
        <a href="${cpath}/gforum.do/zlmodifyPage/GForumID_${forumForm.GForumID}.html"><img src="${cpath}/images/icon_37.gif" width="14" height="14" /> [编辑]  </a> 
		</c:if>
		<c:if test="${forumForm.userID == userID && theForm.qryGroupID != 99999999 }">
        <a href="${cpath}/gforum.do/modifyPage/GForumID_${forumForm.GForumID}.html"><img src="${cpath}/images/icon_37.gif" width="14" height="14" /> [编辑]  </a> 
		</c:if>

        <c:if test="${addflg == 'yes'}">
		<a href="javascript:doReply('','','')"><img src="${cpath}/images/icon_38.gif" width="14" height="14" /> [回复] </a>
		</c:if>
      </td>
     </tr>
     <tr class="bl-detail-content">
       <td height="77" valign="top" class="bl-detail-content-left"><a href="${cpath}/users_home/userID_${forumForm.userID}.html" target="_blank"><img src="${cpath}/${myfn:getUserPic(forumForm.userID)}"  width="51" height="51" class="user_icon_1"></a></td>
       <td colspan="2" class="bl-detail-content-right">${forumForm.content} </td>
     </tr>
     <tr class="bl-detail-content" >
       <td colspan="3" class="bl-detail-content-right"  id='${forumForm.GForumID}' style="display:none;padding-left:40px;text-align:center;"></td>
     </tr>

     <c:set value='0' var="pos"/>
     <c:forEach var="follow" items="${followlist}" varStatus="status" begin="0"> 
	 <!--跟帖-->
	 <c:if test="${follow.gupFollID == 0}">
	 <c:set value="${1+pos}" var="pos"/>
	 <tr class="bl-detail-top2">
       <td width="14%" height="34" valign="top"><b class="color_red">${pos}楼：${myfn:getUserNick(follow.userID)}</b></td>
       <td width="64%"><span>${myfn:formatDate14(follow.mtime, "-")} </span></td>
       <td width="22%" align="right">
		  <c:if test="${myfn:isGroupManager(theForm.qryGroupID,userID) ==  true}">
			<a href="${cpath}/gfollforum_del/GFollowID_${follow.GFollowID}_gupFollID_${follow.gupFollID}.html"><img src="${cpath}/images/icon_39.gif" width="16" height="16" /> [删除] </a> &nbsp;
		  </c:if>
		  <c:if test="${addflg == 'yes'}">
			<a href="javascript:doReply('${follow.GFollowID}','${follow.gupFollID}','${follow.userID}');"><img src="${cpath}/images/icon_40.gif" width="16" height="16" /> [回复] </a>
		  </c:if>		   
	   </td>
     </tr>
	 </c:if> 
	 <c:if test="${follow.gupFollID != 0}">
     <tr class="bl-detail-top2">
       <td width="14%" height="34" valign="top"><b class="color_red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${myfn:getUserNick(follow.userID)}</b></td>
       <td width="64%"><span>${myfn:formatDate14(follow.mtime, "-")} 回复 <b class="color_red">${pos}楼</b></span></td>
       <td width="22%" align="right">
		  <c:if test="${myfn:isGroupManager(theForm.qryGroupID,userID) ==  true}">
			<a href="${cpath}/gfollforum_del/GFollowID_${follow.GFollowID}_gupFollID_${follow.gupFollID}.html"><img src="${cpath}/images/icon_39.gif" width="16" height="16" /> [删除] </a> &nbsp;
		  </c:if>
		  <c:if test="${addflg == 'yes'}">
			<a href="javascript:doReply('${follow.GFollowID}','${follow.gupFollID}','${follow.userID}');"><img src="${cpath}/images/icon_40.gif" width="16" height="16" /> [回复] </a>
		  </c:if>	   
	   </td>
     </tr>
	 </c:if> 
	 <tr class="bl-detail-content">
       <td height="77" valign="top" class="bl-detail-content-left"><!--<a href="${cpath}/users_home/userID_${follow.userID}.html" target="_blank"><img src="${cpath}/${myfn:getUserPic(follow.userID)}"  width="51" height="51" class="user_icon_1"></a>--></td>
       <td colspan="2" class="bl-detail-content-right">
		${follow.content}
      <p class="bl-detail-conten-line">
		&nbsp;
      </p>
      </td>
     </tr>
     <tr class="bl-detail-content" >
       <td colspan="3" class="bl-detail-content-right"  id='${forumForm.GForumID}${follow.GFollowID}${follow.gupFollID}' style="display:none;padding-left:40px;text-align:center;"></td>
     </tr>

	 </c:forEach>
   </table>
       
   <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
	 <!-- <tr>     
       <td width="80%" height="59">
          <a href="${cpath}/gforum_adlist/qryGroupID_${forumForm.groupID}.html" class="bl-btn2"> &lt;&lt; 返回列表</a>
          <a href="#" class="bl-btn2"> 上一主题 </a>
          <a href="#" class="bl-btn2"> 下一主题 </a>
       </td>
       <td width="20%" align="right">&nbsp;
      <a href="${cpath}/gforum.do?action=addPage&groupID=${forumForm.groupID}"><img src="${cpath}/images/icon_35.gif" width="74" height="30" /></a></td>
     </tr>-->
     <tr>
       <td colspan="2">
       
		<div class="page">
			<input type="hidden" name='qryGroupID'	value='${theForm.qryGroupID}'/>
			<input type="hidden" name='qryGForumID' value='${theForm.qryGForumID}'/>
			<input type='hidden' name='GForumID'	value='${forumForm.GForumID}'/>
			<input type='hidden' name='userID'		value='${userID}'/>
			<input type='hidden' name='groupID'		value='${theForm.qryGroupID}'/>
			<input type='hidden' name='GFollowID' id='GFollowID'	value=''/>
			<input type='hidden' name='gupFollID' id='gupFollID'	value=''/>
			<input type='hidden' name='upUserID'  id='upUserID'	value=''/>
		<c:if test="${ theForm.page.totalNum > 0}">
		<!-- 分页主键 formName字段当前的form名称 -->
		<%@ include file="/jsplib/page.jsp" %>
		</c:if>
		<!--隐藏域-->
		<input type="hidden" name='action' value='list'/>	
		</div>
    
       </td>
       </tr>
   </table>
   
   </div>
   <div class="clearFloat"></div>
  </div>
</div>
</form>   
  
    <div class="clearFloat"></div>
 </div> 
 <!--主体 end -->
 
 
 <!--页脚 start -->
	<%@ include file="/foot.jsp"%>
 <!--页脚 end --> 
</div>
<!--外套 end -->

</body>
</html>
<script>
    /**
     * 检查项目资料维护
     */
	function doConfirm(act)
	{
		var form = document.theForm;
		var action = form['action'];

		action.value = act;

		if(act == "add"){

			var content = form['content'].value;
			if(content.length > 20000)
			{
				alert('内容长度不能大于20000');
				return ;
			}	
			form['content'].value = gjcfilter(content);

		}
		form.submit();
	}
    /**
     * 检查项目资料维护
     */
	function doCancel()
	{
		if(curreplyID != ""){
			document.getElementById(curreplyID).innerHTML = "";
		}
	}
	function my_getbyid(id)
	{
		 itm = null;
		 if (document.getElementById)
		 {
				itm = document.getElementById(id);
		 }
		 else if (document.all)
		 {
				itm = document.all[id];
		 }
		 else if (document.layers)
		 {
				itm = document.layers[id];
		 }		 
		 return itm;
	}
    /**
     * 检查项目资料维护
     */
	function doReply(varGFollowID,vargupFollID,varupUserID)
	{

		var userID = "${userID}";
		if(userID == ""){
			alert('回复需要登录网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		document.getElementById('GFollowID').value = varGFollowID;
		document.getElementById('gupFollID').value = vargupFollID;
		document.getElementById('upUserID').value = varupUserID;

		if(curreplyID != ""){
			my_getbyid(curreplyID).innerHTML = "";
		}
		curreplyID = "${forumForm.GForumID}" + varGFollowID + vargupFollID;

		var distxt = "<span class='notice_from' style='width:100%'><p><textarea name='content' rows='' cols=''  class='input'></textarea></p>";
		distxt +=	"	<p>";
		distxt +=	"	<a href='javascript:doConfirm(\"add\");'><img src='${cpath}/images/icon_09.gif' width='83' height='22' /></a> &nbsp; &nbsp; <a href='javascript:doCancel();'><img src='${cpath}/images/icon_45.gif' width='83' height='22' /></a> ";
		distxt +=	"	</p></span>";

		document.getElementById(curreplyID).innerHTML = distxt;

		document.getElementById(curreplyID).style.display = "";
	}

</script>